<?php

namespace App\Http\Controllers\YApi;

//use Illuminate\Http\Request;
use Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use Session;
use Redirect;

use App\Models\UsersReg;

class PhonenumberController extends Controller
{

  	public function phonenumber()
  	{
  		// 判断手机号码是否已经注册过了
  		$mobile = request::input('phonenumber');
  		$phone = UsersReg::where('mobile', $mobile)->first();
  		if($phone != null)
  		{
  			// 手机号码已经存在了
  			return 1;
  		}
  		// 手机号码不存在
  		return 2;		
    }
    
}